import request from '@/utils/request'

// 查询门禁管理列表
export function listControl(query) {
  return request({
    url: '/doorcontrol/control/list',
    method: 'get',
    params: query
  })
}

// 查询门禁管理详细
export function getControl(id) {
  return request({
    url: '/doorcontrol/control/' + id,
    method: 'get'
  })
}

// 新增门禁管理
export function addControl(data) {
  return request({
    url: '/doorcontrol/control',
    method: 'post',
    data: data
  })
}

// 修改门禁管理
export function updateControl(data) {
  return request({
    url: '/doorcontrol/control',
    method: 'put',
    data: data
  })
}

// 删除门禁管理
export function delControl(id) {
  return request({
    url: '/doorcontrol/control/' + id,
    method: 'delete'
  })
}



// 登录门禁
export function hklogin(id) {
  return request({
    url: '/doorcontrol/control/login?id='+id,
    method: 'get'
  })
}

//门禁退出
export function logout(id) {
  return request({
    url: '/doorcontrol/control/logout?id='+id,
    method: 'get'
  })
}

//门禁布防
export function hkbf(id) {
  return request({
    url: '/doorcontrol/control/subscribe?id='+id,
    method: 'get'
  })
}

//门禁撤防
export function hkcf(id) {
  return request({
    url: '/doorcontrol/control/unsubscribe?id='+id,
    method: 'get'
  })
}


//门禁添加用户
export function controladdUser(data) {debugger;
  return request({
    url: '/doorcontrol/user/controladdUser',
    method: 'post',
    data: data
  })
}

